#include "main.h"

void bst_insert(int key, int data)
{
	TreeNode* node = new TreeNode;
	node->key = key;
	node->data = data;

	if (g_root == NULL)
	{
		g_root = node;
		return;
	}

	TreeNode** p = &g_root;

	while (*p != NULL)
	{
		if (key < (*p)->key)
		{
			p = &((*p)->leftChild);
		}
		else
		{
			p = &((*p)->rightChild);
		}
	}
	
	*p = node;
}

int bst_query(int key)
{
	return 0;
}

void bst_delete(int key)
{

}
